﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using lgweb.common;
using LGCourt.Logic.BLL;
using LGCourt.Logic.NBL.DBEntities;

namespace lgweb.inside.FocusNews
{
    public partial class imgdetial : NeedValidatePage
    {
        private int _aid = 1;
        private string _cateName = "图片新闻";
        private string _picUrl = string.Empty;
        protected new void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);
            if (!this.IsPostBack)
            {
                _picUrl = System.Configuration.ConfigurationManager.AppSettings["InfoManage"];
                _picUrl = string.IsNullOrEmpty(_picUrl) ? "http://www.lgfygp.gov.cn/lgmanage/Systems/upload/" : _picUrl;
                GetParam();
                GetInfo();
            }
        }

        private void GetParam()
        {
            this.spBaoCate.HRef = "/inside/FocusNews/imglist.aspx?cate=0";
            this._aid = string.IsNullOrEmpty(Request.QueryString["id"]) ? 1 : Convert.ToInt32(Request.QueryString["id"]);
        }

        private void GetInfo()
        {
            ColInfo bll = new ColInfo();
            this.spBaoCate.InnerHtml = "图片新闻";
            QueryCondition param = new QueryCondition();
            param.id = this._aid;
            LGFY_Platform_NewsOfPic result = (LGFY_Platform_NewsOfPic)bll.GetPicInfo(param);
            if (result != null)
            {
                this.imgPic.Src = _picUrl + result.Pic.ToString();
                this.author.InnerHtml = result.Publishers;
                this.title.InnerHtml = result.Title;
                this.InfoFrom.InnerHtml = result.Comefrom;
                this.content.InnerHtml = result.Text;
                this.viewCount.InnerHtml = result.Hit.GetValueOrDefault(0).ToString();
                this.dtime.InnerHtml = result.PubDate.ToString();

            }
        }

    }
}